import request from '@/utils/request'

// 查询流水号配置列表
export function dataRuleList(query) {
    return request({
        url: '/lims/dataRule/list',
        method: 'get',
        params: query
    })
}

// 查询流水号配置列表
export function ruleList(query) {
    return request({
        url: '/lims/dataRule/formula',
        method: 'get',
        params: query
    })
}

// 查询流水号配置详细
export function getDataRuleForm(ruleId) {
    return request({
        url: '/lims/dataRule/' + ruleId,
        method: 'get'
    })
}

// 新增流水号配置
export function addDataRule(data) {
    return request({
        url: '/lims/dataRule',
        method: 'post',
        data: data
    })
}

// 新增流水号配置
export function addRule(data) {
    return request({
        url: '/lims/dataRule/formula',
        method: 'post',
        data: data
    })
}

// 删除流水号配置
export function delDataRule(ruleId) {
    return request({
        url: '/lims/dataRule/delete/' + ruleId,
        method: 'delete'
    })
}

// 复制
export function copyPager(query) {
    return request({
        url: '/lims/pageConfig/package/copy',
        method: 'get',
        params: query
    })
}

export function getPagerList(query) {
    return request({
        url: '/lims/pageConfig/packageList',
        method: 'get',
        params: query
    })
}

// 查询模板
export function listTemple() {
    return request({
        url: '/lims/pageConfig/tableList',
        method: 'get'
    })
}

// 模板级联原始记录字段
export function listYsjlZd(tableId) {
    return request({
        url: '/lims/pageConfig/componentList/' + tableId,
        method: 'get'
    })
}

// 查询流水号配置列表
export function listTextConfig(query) {
    return request({
        url: '/lims/pageConfig/data/list',
        method: 'get',
        params: query
    })
}

// 查询右侧列表
export function listDataRuleConfig(query) {
    return request({
        url: '/lims/dataRule/paramList',
        method: 'get',
        params: query
    })
}

// 新增流水号列表
export function addPagerConfig(data) {
    return request({
        url: '/lims/pageConfig/data',
        method: 'post',
        data: data
    })
}

// 新增流水号列表
export function addRecordsConfig(data) {
    return request({
        url: '/lims/dataRule/param',
        method: 'post',
        data: data
    })
}

// 删除流水号列表
export function delRecordsConfig(paramIds) {
    return request({
        url: '/lims/dataRule/param/delete/' + paramIds,
        method: 'delete'
    })
}

// 编辑流水号列表
export function getPagerConfigForm(dataId) {
    return request({
        url: '/lims/pageConfig/data/' + dataId,
        method: 'get'
    })
}

// 编辑流水号列表
export function getRecordsConfigForm(paramId) {
    return request({
        url: '/lims/dataRule/param/' + paramId,
        method: 'get'
    })
}

// 查询流水号
export function getSerialNum(query) {
    return request({
        url: '/system/serial/max/data',
        method: 'get',
        params: query
    })
}

// 获取仪器型号下拉框
export function getSelection(query) {
    return request({
        url: '/lims/pageConfig/instrumentList',
        method: 'get',
        params: query
    })
}

// 查询检测项目
export function getJcxmList(query) {
    return request({
      url: '/lims/dataRule/jcxmList',
      method: 'get',
      params: query
    })
  }